package com.huirui.server.pojo.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.time.LocalDate;

@Data
public class UserSettingDto {
    @Schema(description = "用户头像图片URL", example = "https://example.com/avatar.jpg", nullable = true)
    private String imageUrl;

    @Schema(description = "用户手机号码", example = "13800138000", pattern = "^1[3-9]\\d{9}$", nullable = true)
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号码格式不正确")
    private String phoneNumber;

    @Schema(description = "用户昵称", example = "张三", maxLength = 20, nullable = true)
    @Size(max = 20, message = "用户昵称长度不能超过20个字符")
    private String nickName;

    @Schema(description = "用户生日，格式为yyyy-MM-dd", example = "1990-01-01", pattern = "^\\d{4}-\\d{2}-\\d{2}$", nullable = true)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate birthday;
}
